<?php
foreach ($com['Post'] as $value)
    {
        echo "<div class='post5 boardComment'>";
        
                echo "<a href='/urp/posts/view/".$value['id']."' class='postTitle1'>".$value['title']."</a> by <a href='' class='authorName'>".$value['name']."</a>";
                
                if (count($value['Tag']) > 0) {
                echo '<div class="tags1">
                    <b>Tags:</b><span class="tags2">';
                    $tags1="";
                            foreach ($value['Tag'] as $tag) {
                                 if (strpos($tag['tag'],"board:")!==false)
                                     echo "<div><a class='boardLink' href='/urp/posts/?search=".$tag['tag']."'>".$tag['tag']."</a></div>, ";
                                 else if (strpos($tag['tag'],"test:")!==false)
                                     echo "<div><a class='boardLink1' href='/urp/posts/?search=".$tag['tag']."'>".$tag['tag']."</a></div>, ";
                                 else
                                     echo "<div><a href='/urp/posts/?search=".$tag['tag']."' >".$tag['tag']."</a></div>, ";
                                  $tags1.=$tag['tag']." ";
                                   }
                    echo '</span></div>';
                 }
                echo "<br/>";
                echo "<div style='width:45%; clear:right; float:right; display:inline;'>";
                foreach ($value['Comment'] as $value1) { 
                    
                        echo  "<div class='post6'><a href='' class='authorName'>".$value1['name']."</a> said:";
                                        if (count($value1['Tag']) > 0) {
                                        echo '<div class="tags1a">
                                            <b>Tags:</b><span class="tags2">';
                                            $tags1="";
                                                    foreach ($value1['Tag'] as $tag) {
                                                         if (strpos($tag['tag'],"board:")!==false)
                                                             echo "<div><a class='boardLink' href='?search=".$tag['tag']."'>".$tag['tag']."</a></div>, ";
                                                         else if (strpos($tag['tag'],"test:")!==false)
                                                             echo "<div><a class='boardLink1' href='?search=".$tag['tag']."'>".$tag['tag']."</a></div>, ";
                                                         else
                                                             echo "<div><a href='?search=".$tag['tag']."' >".$tag['tag']."</a></div>, ";
                                                          $tags1.=$tag['tag']." ";
                                                           }
                                            echo '</span></div>';
                                         }
                        echo "<p class='commentText'>".bb_code($value1['text'])."</p></div>";
                       
                }
                echo "<br/>";
                echo "</div>";
                
                echo "<div style='width:50%; clear:none; display:inline-block;'>";
                echo "<p class='commentText'>".nl2br($value['body'])."</p>";
                echo "</div>";

                
        echo       "</div>";
    }
	?>